package com.itheima.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
//controller接收处理请求，返回的响应结果实体类
public class Result {
    private Integer code;//响应码
    private String message;//响应内容
    private Object data;//返回的数据

    public static Result success(){return new Result(1,"请求成功",null);}
    public static Result success(Object data){return new Result(1,"请求成功",data);}
    public static Result error(String message){return new Result(0,message,null);}

}
